package com 
{
	import com.greensock.loading.data.VideoLoaderVars;
	import com.greensock.loading.display.ContentDisplay;
	import com.greensock.loading.VideoLoader;
	/**
	 * ...
	 * @author ...
	 */
	public class FlaVideo extends FlaObject
	{
		private var _video:VideoLoader;
		
		override public function get width():Number {
			return _video.content.width;
		}
		override public function set width(value:Number):void {
			_video.content.width = value;
		}
		
		override public function get height():Number {
			return _video.content.height;
		}
		override public function set height(value:Number):void {
			_video.content.height = value;
		}
		
		public function get paused():Boolean {
			if (_video)
				return _video.videoPaused;
			else
				return false;
		}
		public function get time():Number {
			return _video.videoTime;
		}
		
		public function FlaVideo(url:String) 
		{
			_video = new VideoLoader(url, new VideoLoaderVars().autoPlay(false));
			_video.load();
			addChild(_video.content);
		}
		
		public function play():void {
			_video.videoTime = 0;
			_video.playVideo();
		}
		public function stop():void {
			_video.pauseVideo();
		}
		
		public function setRegistrationPoint(regx:Number, regy:Number):void {
			_video.content.x = -regx;
			_video.content.y = -regy;
		}
		
		public override function kill():void {
			super.kill();
			_video.pause();
			removeChild(_video.content);
			_video = null;
		}
	}

}